﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DesignPattern.StrategyPattern
{
    /// <summary>
    /// 策略模式需要一个上下文
    /// </summary>
    public class StrategyContext
    {
        IDiscount Discount;
        //实例化的时候,根据传进来不同的对象调用不同方法
        public StrategyContext(IDiscount discount)
        {
            Discount = discount;
        }

        public void GetContextDiscount()
        {
            Discount.GetDiscount();
        }
    }
}
